const path = require('path');
const appData = require('./src/mock/data');

function resolve(dir) {
    return path.join(__dirname, dir);
}

module.exports = {
    lintOnSave: true,
    chainWebpack: (config) => {
    config.resolve.alias
    .set('@$', resolve('../src'))
    .set('common', resolve('../src/common'))
    .set('components', resolve('../src/components'))
     publicPath: './'

},
devServer:{
    disableHostCheck: true,
        port:8080,
        open:true,
        proxy:{
        '/data':{
            target:'http://localhost:8080',
                changeOrigin:true,
                ws:true
        }
        },
    before(app){
        app.get("/src/mock/appData", (req,res) => {
            res.json(appData)
    })
    }
}
}